<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>展示作者</title>
</head>
<body>
{% load static %}
<button><a href="{% url 'addauthor' %}">添加作者</a></button>
<table border="1" width="1000px" height="300px" bgcolor="#ffc0cb">
    <tr align="center">
        <td>id</td>
        <td>姓名</td>
        <td>头像</td>
        <td>电话</td>
        <td>邮箱</td>
        <td colspan="3">操作</td>
    </tr>
    {% for x in nowpage.object_list %}
        <tr align="center">
            <td>{{ x.id }}</td>
            <td>{{ x.name }}</td>
            <td><img src="/static/{{ x.icon }}" width="100px"></td>
            <td>{{ x.phone }}</td>
            <td>{{ x.email }}</td>
            <td><a href="{% url 'delauthor' x.id %}">删除</a></td>
            <td><a>修改</a></td>
            <td><a href="{% url 'search' x.id %}">查看博客</a></td>
        </tr>
    {% endfor %}
    <th>
        {% if lastpage > 0 %}
            <a href="{% url 'showauthor' %}?page={{ lastpage }}">上一页</a>
        {% endif %}
        <b>当前页{{ nowpage.number }}</b>
        {% if sum >= nextpage %}
            <a href="{% url 'showauthor' %}?page={{ nextpage }}">下一页</a>
        {% endif %}
        共{{ sum }}页
    </th>
</table>
</body>
</html>